package br.com.cubedesk.engine;

import java.text.ParseException;
import javax.swing.JFormattedTextField;
import javax.swing.JOptionPane;
import javax.swing.text.DefaultFormatterFactory;
import javax.swing.text.MaskFormatter;

public class Engine {
    
    public static void mascaraTelefone(JFormattedTextField ftext) {
        try {
            MaskFormatter telefone = new MaskFormatter("(##) ####-####");
            ftext.setFormatterFactory(new DefaultFormatterFactory(telefone));
        } catch (ParseException ex) {
            JOptionPane.showMessageDialog(null, "Erro ao aplicar mascara de telefone.\nErro " + ex.getMessage());
        }
    }
    
     
    
}
